package top.bulk.demo.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author 散装java
 * @version 1.0.0
 * @date 2022-11-13
 */
@WebFilter(filterName = "bulkFilter", urlPatterns = "/*")
public class BulkFilter1 implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("BulkFilter1 init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("BulkFilter1 doFilter 进入方法前");
        filterChain.doFilter(servletRequest, servletResponse);
        System.out.println("BulkFilter1 doFilter Response响应前");
    }

    @Override
    public void destroy() {
        System.out.println("BulkFilter1 doFilter");
    }
}
